package com.persondemo.videoappliction.ui.adapter;

import android.content.Context;
import android.content.Intent;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.persondemo.videoappliction.R;
import com.persondemo.videoappliction.bean.VideoBean;
import com.persondemo.videoappliction.ui.video.VideoDetilsActivity;
import com.persondemo.videoappliction.utils.ImageLoaderUtil;

import java.util.List;

/**
 * Created by Administrator on 2018/3/21.
 */

public class RecyclerAdapter extends BaseQuickAdapter<VideoBean, BaseViewHolder> {
    private Context mContext;

    public RecyclerAdapter( @Nullable List<VideoBean> data, Context mContext) {
        super(R.layout.module_include_recycle, data);
        this.mContext = mContext;
    }

    @Override
    protected void convert(BaseViewHolder helper, VideoBean item) {
        helper.getView(R.id.recler_base_img).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mContext.startActivity(new Intent(mContext, VideoDetilsActivity.class));
            }
        });
    }
}
